<template>
   <div class="echart">
    <div class="title">
        <div class="text">数据概况</div>
    </div>
    <div id="main" class="main">

    </div>
   </div>
</template>

<script setup lang="ts">
import {  onMounted} from "vue";
import * as echarts from 'echarts';
onMounted(()=>{

   
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;

option = {
 
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    // data: ['居民数量','签约量','服务量'],
    data: [
        {icon:'circle',name:'居民数量',},
        {icon:'circle',name:'签约量',},
        {icon:'circle',name:'服务量',},
        
],
   left:'10',
  },
  grid: {
    left: '3%',
    right: '19%',
    bottom: '3%',
    containLabel: true
  },
 
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: ['1/4', '1/5','1/6','1/7','1/8','1/9','1/10',]
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      name: '居民数量',
      type: 'line',
      stack: 'Total',
      data: [120, 132, 101, 134, 90, 230, 210]
    },
    {
      name: '签约量',
      type: 'line',
      stack: 'Total',
      data: [220, 182, 191, 234, 290, 330, 310]
    },
    {
      name: '服务量',
      type: 'line',
      stack: 'Total',
      data: [150, 232, 201, 154, 190, 330, 410]
    },

  ]
};

option && myChart.setOption(option);
})


</script>

<style scoped lang="scss">
.echart{
    height: 400px;
    width:70%;
    padding-left: 20px;
    background-color: #fff;
    box-sizing: border-box;
    border-radius: 10px;
}
.title{
    height: 50px;
    width: 100%;
    margin-bottom: 30px;
    .text{
        line-height: 50px;
        font-weight: 1000;
        font-size: 20px;
        box-sizing: border-box;
        border-bottom: 1px solid #ccc;
    }
}
.main{
    height: 300px;

}
</style>